package Behaviors;

import lejos.nxt.Button;
import lejos.robotics.subsumption.Behavior;


/**
 * Exit behavior in subsumption architecture.
 * Enables the user to press ESCAPE button on the NXT Robot to shut down the program. 
 * @author Didzis Petkus, Danny Johansen, Liviu Berheci
 *
 */
public class Exit implements Behavior {

	@Override
	public boolean takeControl() {
		return Button.ESCAPE.isDown();
	}

	@Override
	public void action() {
		// TODO Maybe set some boolean that we are finished.
		// All we want to do is sent the data and then shutdown:)
		System.exit(0);
	}

	@Override
	public void suppress() {
	}

}
